package com.sharemarking.wa.platform.controller;

import com.sharemarking.wa.common.ResponseParams;
import com.sharemarking.wa.platform.service.DispatcherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dxy
 */
@RequestMapping("dispatcher")
@RestController
public class DispatcherController {
    @Autowired
    private DispatcherService dispatcherService;

    /**
     * 新增或编辑
     * @return
     * @throws Exception
     */
    @RequestMapping("addOrEdit")
    public ResponseParams<?> addOrEdit() throws Exception {
        return dispatcherService.addOrEdit();
    }

    /**
     * 重置密码
     * @return
     * @throws Exception
     */
    @RequestMapping("resetPwd")
    public ResponseParams<?> resetPwd() throws Exception {
        return dispatcherService.resetPwd();
    }


    /**
     * 获取调度员列表
     * @return
     * @throws Exception
     */
    @RequestMapping("getList")
    public ResponseParams<?> getList() throws Exception {
        return dispatcherService.getList();
    }


    /**
     * 获取调度员详情
     * @return
     * @throws Exception
     */
    @RequestMapping("getInfo")
    public ResponseParams<?> getInfo() throws Exception {
        return dispatcherService.getInfo();
    }


    /**
     * 删除调度员
     * @return
     * @throws Exception
     */
    @RequestMapping("delete")
    public ResponseParams<?> delete() throws Exception {
        return dispatcherService.delete();
    }

}
